package demo.gui;

import static org.lwjgl.opengl.GL11.glColor3f;

import org.lwjgl.input.Keyboard;
import org.lwjgl.util.glu.Sphere;

import engine.gameObject.DynamicObject;
import engine.gameObject.listener.KeyListener;

public class TestObject extends DynamicObject implements KeyListener{

	private boolean move;
	
	public TestObject() {
		super();
		setBounds(0, 0, 0, 2);
	}
	
	@Override
	public void render(float timeElapsed) {
		
		glColor3f(1, 1, 0);
		new Sphere().draw(2, 10, 10);
	}
	
	@Override
	public void update(float timeElapsed) {
		if(move) {
//			setNewPosition(getPosX(), getPosY() + 0.01f, getPosZ());
			setVelocity(0, 1, 0);
		} else {
			setVelocity(0, 0, 0);
		}
	}
	
	@Override
	public void keyPressed(int key) {
		if(key == Keyboard.KEY_M) {
			move = true;
		}
	}

	@Override
	public void keyReleased(int key) {
		move = false;
	}

}
